package com.aloaproject.ciquta.core;

import java.util.Collection;

import com.aloaproject.ciquta.Criteria;
import com.aloaproject.ciquta.CriteriaImpl;
import com.aloaproject.ciquta.criterion.Example;

public class QueryEngine {

	static final Collection findByCriteria(Criteria criteria) {
		return criteria.list();
	}
	
	static final Collection findByExample(Collection c, Object entity) {
		Criteria criteria = CriteriaImpl.forCollection(c);
		criteria.add(Example.create(entity));
		return criteria.list();
	}
	
}
